#include<iostream>
#include"login.pb.h"
#include"mprpc.h"
#include"mprpcchannel.h"
#include"mprpccontroller.h"


int main(int argc,char** argv)
{   
    //框架初始化
    Mprpc::Init(argc,argv);

    login::UserServiceRpc_Stub stub(new MprpcChannel());
    login::LoginRequest request;
    login::LoginResponse response;

    request.set_name("张三");
    request.set_pwd("123456");

    //发起rpc调用
    MprpcController con;
    stub.Login(&con,&request,&response,nullptr);
    const login::ResultCode result=response.result();
    std::cout << "resultcode:" << result.errcode() << std::endl;
    std::cout << "resultcode:" << result.errmesg() << std::endl;
    std::cout << "success:" << response.success() << std::endl;
   
    std::cout << con.ErrorText() << std::endl;
    return 0;
}